<?php include THEMES_PATH . 'public/before_body2.phtml'; ?>
<link href="/statics/front/css/cart.css" rel="stylesheet">
</head>
<body>
<?php include THEMES_PATH . 'public/header2.phtml';?>
<div class="clearfix">
  <div class="main-width heading">
    <strong><?php echo L('my_measure_new');?></strong>
  </div>
  <div class="main-width figure-container">
    <form method="post" action="__SELF__" >
      <input type="hidden" name="cid" value="<?php echo $cid;?>">
      <table border="0" cellpadding="0" cellspacing="0" class="figure-list">
        <tbody>
          <tr>
            <th width="60%" colspan="2"><?php echo L('Frame_data');?></th>
            <th width="40%"><a href="<?php echo url('measure/add');?>" class="pull-right btn btn-middle"><?php echo L('Create_new_data_list');?></a></th>
          </tr>
          <?php
          if (isset($measureList) && $measureList) :
            foreach ($measureList as $key=>$measure) :
          ?>
          <tr>
          <td>
            <label for="mid_<?php echo $measure['id'];?>">
              <input type="radio" name="mid" id="mid_<?php echo $measure['id'];?>" value="<?php echo $measure['id']; ?>" <?php if($key==0){ echo "checked";}?>> 
              <span><?php echo $measure['measure_name']; ?></span>
            </label>
          </td>
          <td>
            <label for="mid_<?php echo $measure['id'];?>" class="data">
              <?php echo date('m-d-Y H:i',$measure['update_time']);?>
            </label>
          </td>
          <td class="figure-operate">
            <div class="figure-view js-figure-view">
              <a href="javascript:" class="js-view-trigger"><?php echo L('show')?></a> /
              <div class="figure-info">
                <span class="close js-close">×</span>
                <table cellpadding="0" cellspacing="0" width="100%">
                  <?php
                      $measure_data = unserialize($measure['measure_data2']);
                      if(!$measure_data)
                          $measure_data = unserialize($measure['measure_data']);
                      if (isset($measure_data) && $measure_data) :
                          foreach ($measure_data as $key => $val) :
                  ?>
                  <tr>
                    <td width="40%"><?php echo $key;?></td>
                    <td width="60%">
                    <?php 
                      if(is_array($val)){
                          foreach ($val as $key2 => $val2){
                              if($key2=='type'){
                              //身形数据暂时修复 有type的为二维数据
                                  echo (is_array($val2))?$val2['type']:$val.'&nbsp;';
                              }else{
                                  echo $val2.$key2.' ';
                              }
                          }
                      }else{
                          echo  $val;
                      }
                    ?>
                    </td>
                  </tr>
                  <?php
                          endforeach;
                      endif;
                  ?> 
                </table>
              </div>
            </div>
            <a href="<?php echo url('measure/add', array('mid' =>$measure['id']));?>"><?php echo L('edit')?></a> 

          </td>
        </tr>
          <?php
        endforeach;
        else:
    ?>
          <tr class="shopcart-tmain">
            <td colspan="3" align="center"><?php echo L('nothing_in_cart');?></td>
          </tr>
          <?php  endif;?>
          <tr>
            <td colspan="3" style="padding:50px 0;border-bottom:none;"><?php echo L('size_yorself_yourfriend');?></td>
          </tr>
          <tr>
            <td colspan="3" align="center" style="border-bottom:none;">
              <input type="submit" value="<?php echo L('ADD_TO_CART');?>" class="btn btn-middle" />
            </td>
          </tr>
        </tbody>
      </table>
    </form>
  </div>
</div>
<script src="/statics/front/js/scripts/cart/common.js"></script>
<?php include THEMES_PATH.'public/footer2.phtml';?>
<?php include THEMES_PATH.'public/after_body.phtml';?>